{template header}
	<div id="positionBox">
		<div class="left">
			<a href="{WEBURLPATH}/index.php">首页</a>&gt;
			<a href="{WEBURLPATH}/my.php">个人中心</a>&gt;
			<!--{if in_array($webglobal['action'], array('', 'avatar', 'password', 'auth'))}-->
				个人设置
			<!--{elseif $webglobal['action'] == 'favorite'}-->
				优惠劵收藏
			<!--{elseif $webglobal['action'] == 'favoritecom'}-->
				商家收藏
			<!--{elseif $webglobal['action'] == 'credit'}-->
				我的积分
			<!--{/if}-->
		</div>
	</div>
<style>
.e2{
	width:700px;
}
.e2 li{
	width:100%;
	overflow:hidden;
	clear:both;
	padding:12px 0px;
	border-bottom:1px solid #EEE;
	color:#aaa;
}
.e2 li b a{
	color:#555;
}
.e2 li a.preview{
	width:84px;
	float:left;
	margin-right:7px;
	margin-bottom:3px;
	margin-left:10px;
	display:inline;
}
.e2 li a.preview img{
	width:80px;
	height:80px;
	display:block;
	padding:1px;
	border:1px solid #EEE;
}
.e2 li a.preview:hover img{
	width:80px;
	height:80px;
	border:1px solid #AAA;
}
.e2 li a.title{
	overflow:hidden;
	line-height:25px;
	font-weight:bold;
	font-size:14px;
	margin-left:2px;
	color:#FF8E4B;
}
.e2 span.info{
	display:block;
	line-height:23px;
	color:#555;
	padding-left:12px;
}
.e2 span.info small{
	color:#AAA;
	font-size:12px;
	margin-left:3px;
}
.e2 span.info a{
	color:#690;
}
.e2 p.intro{
	color:#776955;
	line-height:20px;
	margin-left:5px;
	padding-left:10px;
	padding-right:10px;
	text-indent:0em;
	margin:0px;
	padding:0px;
	font-size:13px;
}
</style>
	<div class="c_2_1">
		<div class="leftmenu">
			<div class="leftmenu_top"></div>
			<div {if in_array($webglobal['action'], array('', 'avatar', 'password', 'auth'))}class="leftmenu_on"{else}class="leftmenu_off"{/if}><a href="{WEBURLPATH}/my.php">个人设置</a></div>
			<div {if $webglobal['action']=='favorite'}class="leftmenu_on"{else}class="leftmenu_off"{/if}><a href="{WEBURLPATH}/my.php?action=favorite">我收藏的优惠券</a></div>
			<div {if $webglobal['action']=='favoritecom'}class="leftmenu_on"{else}class="leftmenu_off"{/if}><a href="{WEBURLPATH}/my.php?action=favoritecom">我收藏的商家</a></div>
			<div {if $webglobal['action']=='credit'}class="leftmenu_on"{else}class="leftmenu_off"{/if}><a href="{WEBURLPATH}/my.php?action=credit">我的积分</a></div>
			<div class="leftmenu_bottom"></div>
		</div>
	</div>
	<div class="c_2_2">

<!--{if $webglobal['action']=='favorite'}-->

	<div class="linetitle">我收藏的优惠券</div>
	<!--{if $webglobal['datanum']>0}-->
		<!--{loop $webglobal['dataarray'] $tempvalue}-->


<div class="listbox"><ul class="e2"><li>
					<!--{if !empty($tempvalue['c_image'])}-->
						<a class="preview" href="{WEBURLPATH}/coupon.php?action=view&id={$tempvalue['coupon_id']}"><img src="{WEBURLPATH}{$tempvalue['thumbnail']['small']}" alt="" /></a>
					<!--{else}-->
						NO
					<!--{/if}-->

<b>优惠券: </b>
 <a class="title" href="{WEBURLPATH}/coupon.php?action=view&id={$tempvalue['coupon_id']}" target="_blank"><font>{$tempvalue['c_name']}</font></a>
 <span class="info"> 
 <small>收藏时间：</small>{$tempvalue['addtime_show']}
 <br />
<a style="color:#FF8E4B;" href="javascript:if(confirm('您确定要删除该收藏吗？')){window.location.href='{WEBURLPATH}/my.php?action=favorite&delid={$tempvalue['id']}&page={$webrequest['page']}'}">[删除收藏]</a>
</li></ul></div>




		<!--{/loop}-->
		{template page}
	<!--{else}-->
		<div>暂无收藏的信息</div>
	<!--{/if}-->

<!--{elseif $webglobal['action']=='favoritecom'}-->

	<div class="linetitle">我收藏的商家</div>
	<!--{if $webglobal['datanum']>0}-->
		<!--{loop $webglobal['dataarray'] $tempvalue}-->


<div class="listbox"><ul class="e2"><li>
					<!--{if !empty($tempvalue['c_logo'])}-->
						<a class="preview"><img src="{WEBURLPATH}{$tempvalue['c_logo']}" alt="" /></a>
					<!--{else}-->
						NO
					<!--{/if}-->

<b>商家: </b>
 <a class="title" href="{WEBURLPATH}/company.php?action=view&id={$tempvalue['company_id']}" target="_blank"><font>{$tempvalue['c_name']}</font></a>
 <span class="info"> 
 <small>收藏时间：</small>{$tempvalue['addtime_show']}
 </span>
 <br />
<a style="color:#FF8E4B;" href="javascript:if(confirm('您确定要删除该收藏吗？')){window.location.href='{WEBURLPATH}/my.php?action=favoritecom&delid={$tempvalue['id']}&page={$webrequest['page']}'}">[删除收藏]</a>
</li></ul></div>

		<!--{/loop}-->
		{template page}
	<!--{else}-->
		<div>暂无收藏的信息</div>
	<!--{/if}-->

<!--{elseif $webglobal['action']=='credit'}-->

	<div class="linetitle">我的积分资料</div>
	<div>剩余积分：{$user['score']}</div>
	<a href="{WEBURLPATH}/change.php" class="colorbutton">我要兑换</a>
	<div class="linetitle">积分兑换记录</div>
	<!--{if $webglobal['datanum']>0}-->
		<!--{loop $webglobal['dataarray'] $tempvalue}-->
		<div class="listbox">
			<ul class="e2">
			<li>
				<!--{if !empty($tempvalue['g_image'])}-->
					<a class="preview"><img src="{WEBURLPATH}{$tempvalue['thumbnail']['small']}" alt="" /></a>
				<!--{else}-->
					NO
				<!--{/if}-->
				<b>兑换奖品: </b>
				<a class="title" href="{WEBURLPATH}/change.php?action=view&id={$tempvalue['integral_goods_id']}" target="_blank">{$tempvalue['g_name']}</a>
				<span class="info"> 
					<small>单个兑换所需积分：</small>{$tempvalue['unit_score']} 
					<small>兑换数量：</small>{$tempvalue['quantity']} 
					<small>当前状态：</small>{$webglobal['integral_status'][$tempvalue['status']]} 
					<small>兑换时间：</small>{$tempvalue['addtime_show']}
				</span>
				<p class="intro">奖品说明:{$tempvalue[g_description]} </p>
			</li>
			</ul>
		</div>
		<!--{/loop}-->
		{template page}
	<!--{else}-->
		<div>暂无积分兑换记录</div>
	<!--{/if}-->
<!--{elseif $webglobal['action']=='credit'}-->
<!--{elseif $webglobal['action'] == '' || $webglobal['action'] == 'avatar' || $webglobal['action'] == 'password' || $webglobal['action'] == 'auth'}-->
{templatecss my}
<!-- <div class="linetitle">个人设置</div> -->
<!--{if !empty($webglobal[CPM])}-->
	<div class="listulstyle">
		<ul>
			<!--{loop $webglobal[CPM] $tempkey $tempvalue}-->
			<li><span style="color:red">$tempvalue</span></li>
			<!--{/loop}-->
		</ul>
	</div>
	<div class="blankline"></div>
<!--{/if}-->
<div class="main my_info">
	<div class="b">
		<div class="c">
			<div class="tab">
				<ul>
					<li{if $webglobal['action'] == ''} class="current"{/if}><a href="{WEBURLPATH}/my.php">个人信息</a></li>
					<li{if $webglobal['action'] == 'avatar'} class="current"{/if}><a href="{WEBURLPATH}/my.php?action=avatar">修改头像</a></li>
					<li{if $webglobal['action'] == 'password'} class="current"{/if}><a href="{WEBURLPATH}/my.php?action=password">密码管理</a></li>
					<li{if $webglobal['action'] == 'auth'} class="current"{/if}><a href="{WEBURLPATH}/my.php?action=auth">身份认证</a></li>
				</ul>
			</div>
			<!--{if $webglobal['action'] == 'auth' && $user['status'] != 1}-->
			<div class="tab_sub fn">
				<ul>
					<li{if $webrequest['type'] == 'email'} class="current"{/if}><a href="{WEBURLPATH}/my.php?action=auth&type=email">邮箱激活</a></li>
					<li{if $webrequest['type'] == 'idcode'} class="current"{/if}><a href="{WEBURLPATH}/my.php?action=auth&type=idcode">身份认证</a></li>
					<li{if $webrequest['type'] == 'mobil'} class="current"{/if}><a href="{WEBURLPATH}/my.php?action=auth&type=mobil">手机认证</a></li>
				</ul>
			</div>
			<!--{/if}-->
			<ul class="personal_info" id="personalInfo">
				<li class="">
					{if $webglobal['action'] == ''}
						<script type="text/javascript" src="{WEBURLPATH}/javascript/jquery.linkagesel-min.js"></script>
						<script type="text/javascript" src="{WEBURLPATH}/javascript/district-all.js"></script>
						<form method="post" name="regform" id="regform" enctype="multipart/form-data" action="{WEBURLPATH}/my.php?check" class="basic_info">
						<label>E-mail：</label><span>{$user['email']}</span><br>
						
						<label>性别：</label>
							<select name="gender">
								<option value="0"{if $user['gender']==0} selected="selected"{/if}>保密</option>
								<option value="1"{if $user['gender']==1} selected="selected"{/if}>男</option>
								<option value="2"{if $user['gender']==2} selected="selected"{/if}>女</option>
							</select>
						<br>
						<label>生日：</label>
						{if $user[auth_indentity]}
						{echo implode('-', $user[birthday])}
						{else}
						<select name="birthday_year">
						<option value="0">年</option>
						<!--{loop $webglobal['birthday_num']['birthday_year'] $value}-->
						<option value="{$value}"{if isset($user['birthday'][0]) && $user['birthday'][0] == $value} selected{/if}>{$value}</option>
						<!--{/loop}-->
						</select>
						<select name="birthday_month">
						<option value="0">月</option>
						<!--{loop $webglobal['birthday_num']['birthday_month'] $value}-->
						<option value="{$value}"{if isset($user['birthday'][1]) && $user['birthday'][1] == $value} selected{/if}>{$value}</option>
						<!--{/loop}-->
						</select>
						<select name="birthday_day">
						<option value="0">日</option>
						<!--{loop $webglobal['birthday_num']['birthday_day'] $value}-->
						<option value="{$value}"{if isset($user['birthday'][2]) && $user['birthday'][2] == $value} selected{/if}>{$value}</option>
						<!--{/loop}-->
						</select>
						<!-- <input type="text" name="birthday" style="width:213px;" value="{$user[birthday]}" /> -->
						{/if}
						
						<br>
						<label>出生地：</label>
						{if $user[auth_indentity]}
						{$user['birth_address']['area_text']}
						{else}
						<select id="birthday_province" name="birthday_address[]"></select>
						<select id="birthday_city" name="birthday_address[]"></select>
						<select id="birthday_district" name="birthday_address[]"></select>
						<input type="hidden" id="birthday_address_name" name="birthday_address_name" value="{$user['birth_address']['area_text']}" />
						{/if}
						
						<br>
						<label>真实姓名：</label>
						<input type="text" name="truename" size="32" value="{$user[truename]}" />
						<br>
						<label>身份证号码：</label>
						{if $user[indentitycard]}
							{$user[indentitycard]}
						{else}
							<span style="font-weight:bold;">请在身份认证系统里填写正确的身份证号码</span>
						{/if}
						<br>
						<label>手机：</label>
						<input type="text" name="tel" size="32" value="{$user[tel]}" />
						<br>
						<label>昵称：</label>
						<input type="text" name="nickname" size="32" value="{$user[nickname]}" />
						<br>
						<label>个性签名：</label>
						<textarea id="signhtml" name="signhtml" style="width:213px;height:100px;">{$user[signhtml]}</textarea>
						<br>
						<label>兴趣爱好：</label>
						<!--{loop $webcache['setting']['user_interests'] $tempkey $tempvalue}-->
							<input type="checkbox" class="noborder" name="interests[]" id="interests_{$tempkey}" value="{$tempvalue}"{if in_array($tempvalue, $user['interests'])} checked="checked"{/if} />$tempvalue&nbsp;&nbsp;&nbsp;&nbsp;
						<!--{/loop}-->
						其他 <input type="text" name="other_interest" size="15" value="{$user[other_interest]}" />
						<br>
						<input type="submit" class="btn" value="保存">
						</form>
						<script type="text/javascript">
							$(document).ready(function(){
								var opts = {
										data: districtData,
										selStyle: 'margin-left: 3px;',
										select: ['#birthday_province', '#birthday_city', '#birthday_district'],
										defVal: [{$user['birth_address']['id_list']}]
								};
								var linkageSel = new LinkageSel(opts);
								districtData = opts = null; // 如果数据量大最好在创建LinkageSel实例之后清空

								linkageSel.onChange(function() {
									var input = $('#birthday_address_name'),
										d = this.getSelectedDataArr('name'),    // 所有有选定菜单的name. this === linkageSel2
										arr = [];
									for (var i = 0, len = d.length; i < len; i++) {
										arr.push(d[i]);
									}
									input.val(arr.join(','));
								});
							});
						</script>
					{elseif $webglobal['action'] == 'avatar'}
						{if isset($webrequest['check'])}
							<script type="text/javascript">
							<!--
								function ChangePic(strid, strfile)
								{
									var commplace = strid.indexOf(',');
									if (commplace>0 && strfile==null)
									{
										strfile = strid.slice(commplace+1);
										strid = strid.slice(0, commplace);
									}
									if (document.getElementById)
									{
										var imgobj = document.getElementById(strid);
										if (imgobj)
										{
											var timenow = new Date().getTime();
											imgobj.src = strfile+'?'+timenow;
										}
									}
								}
							//-->
							</script>
							<br /><br />
							<div style="border:5px solid #ccc;width:300px;float:left"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="300" height="400" id="cutpic" align="middle">
							<param name="allowScriptAccess" value="sameDomain" />
							<param name="allowFullScreen" value="false" />
							<param name="quality" value="high" />
							<param name="movie" value="{WEBURLPATH}/images/cutpic.swf" />
							<param name="FlashVars" value="{$webglobal['flashVars']}" />
							<embed src="{WEBURLPATH}/images/cutpic.swf" FlashVars="{$webglobal['flashVars']}" width="300" height="400" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
							</object></div>
							<div style="width:200px;float:left;margin-left:50px;">
								<div class="fbig fstrong">在左侧调整头像尺寸并保存。</div><br />
								<img src="{WEBURLPATH}{$webglobal['CPD']['avatar']}" alt="" id="simgshow" width="120" height="120" />
							</div>
							<div class="clear"></div>
						{else}
							
							<form method="post" name="regform" id="regform" enctype="multipart/form-data" action="{WEBURLPATH}/my.php?action=avatar&check" class="basic_info">
								<!--{if $user[avatar]!=''}--><div class="fbig fstrong">您当前头像</div><div>如果您刚保存了头像，可能需要刷新一下本页面(按F5键)，才能查看最新的头像效果。</div><img src="{WEBURLPATH}{$user[avatar]}" height="120" width="120" alt="" border="0" /><br /><br /><!--{/if}-->
								<div class="fbig fstrong">设置我的新头像</div><div>请选择一个新照片进行上传编辑，格式为 gif, jpg, png。</div>
									<input type="file" name="avatar" size="20" />
									<input type="submit" class="btn" value="上传">
							</form>
						{/if}
					{elseif $webglobal['action'] == 'password'}
						<form method="post" name="regform" id="regform" enctype="multipart/form-data" action="{WEBURLPATH}/my.php?action=password&check" class="basic_info">
						<label>原密码：</label>
						<input type="password" name="passwordold" size="32" value="" /> 不修改请留空
						<br>
						<label>修改登录密码：</label>
						<input type="password" name="password" size="32" value="" /> 不修改请留空
						<br>
						<label>重复输入密码：</label>
						<input type="password" name="passwordtwo" size="32" value="" /> 不修改请留空
						<br>
						<input type="submit" class="btn" value="保存">
						</form>
					{elseif $webglobal['action'] == 'auth'}
						{if $user['status'] == 1}
							<div class="tipsbox">
								<div class="tit">提示信息</div>
								<div class="cont">恭喜您，您已经通过了实名认证!</div>
							</div>
						{elseif $webrequest['type'] == 'email'}
							<div class="tipsbox">
								<div class="tit">提示信息</div>
								<div class="cont">邮箱账号已经激活。</div>
							</div>
						{elseif $webrequest['type'] == 'idcode'}
							{if $user['auth_indentity'] == 1}
								<div class="tipsbox">
									<div class="tit">提示信息</div>
									<div class="cont">恭喜您，您已经通过了身份认证!</div>
								</div>
							{elseif $user['birthday'] == '0000-00-00' || $user['birth_address'] == ''}
								<div class="tipsbox">
									<div class="tit">提示信息</div>
									<div class="cont">对不起，请您先完善个人信息再进行身份验证!</div>
								</div>
							{else}
								<form method="post" name="regform" id="regform" enctype="multipart/form-data" action="{WEBURLPATH}/my.php?action=auth&type=idcode&check" class="basic_info">
								<label>身份证号码：</label>
								<input type="text" name="indentitycard" size="32" value="" /> *(请填写正确的身份证号码)
								<br>
								<input type="submit" class="btn" value="开始认证">
								</form>
							{/if}
						{elseif $webrequest['type'] == 'mobil'}
							<div class="tipsbox">
								<div class="tit">提示信息</div>
								<div class="cont">等待完善该功能！</div>
							</div>
						{/if}
					{/if}
				</li>
			</ul>
		</div>
	</div>
</div>

<!--{/if}-->

	</div>
	<div class="clear"></div>
{template footer}